﻿using System;
using System.Collections.Generic;
using System.Drawing;

namespace MaterialEditor
{
    public class TypeColorLookup
    {
        /// <summary>
        /// Singleton instance
        /// </summary>
        private static TypeColorLookup _instance;

        /// <summary>
        /// Singleton accessor
        /// </summary>
        public static TypeColorLookup instance
        {
            get
            {
                if (_instance == null)
                    _instance = new TypeColorLookup();

                return _instance;
            }
        }

        private Dictionary<NodeValueType, Color> lookup = new Dictionary<NodeValueType, Color>()
        {
            { NodeValueType.ValueColor, Color.Lime  },
            { NodeValueType.ValueFloat, Color.Blue },
            { NodeValueType.ValueTexture, Color.Red },
            { NodeValueType.ValueVector2, Color.Yellow },
            { NodeValueType.ValueVector3, Color.Purple },
        };

        /// <summary>
        /// Gets a color used for the pituclar value type
        /// </summary>
        /// <param name="type">The type of color to lookup</param>
        /// <returns>The color for this type</returns>
        public Color this[NodeValueType type]
        {
            get { return lookup[type]; }
        }
    }
}